The JBIG (Joint Bi-level Image Group) system was proposed as a new bi-level image encoding method which is appropriate not only for hard copy communication such as facsimile communication but also for soft copy communication such as computer image data communication.
FIG. 1 shows a block diagram illustrating a standard JBIG system. A first block 101 is an electric circuit which uses a PRES (Progressive REduction Scheme) as an image resolution reduction system. A second block 102 is an electric circuit for performing DP (Deterministic Prediction). The DP is used to deterministicly predict a value of a pixel which is being encoded from values of surrounding pixels which have already been encoded. By using the DP, it is possible to improve an encoding efficiency. A third block is an electric circuit for setting a model template. A template is a reference pixel model to be used in encoding. FIG. 2 shows an example of such a template. In the example, the template includes 10 pixels `1` to `10` surrounding a pixel to be encoded. Using such a template, encoding is performed using an M.sub.1 -order Markov model on a minimum resolution-reduced image. Specifically, M.sub.1 pixels in proximity of each to-be-encoded pixel which have been already encoded are used as the reference pixels of the template. Possible states (combinations) of the values of the reference pixels are 2.sup.M1 states. For each one of these states, a respective predetermined conditional probability of a symbol is given. Using thus given probabilities of the symbol for to-be-encoded pixels and actual values (symbols), entropy encoding is performed. A fourth block 104 is an entropy encoding circuit and uses the JBIG QM coder. (The JBIG QM coder is a QM coder used in the JBIG. Usually, an arithmetic encoder is called a QM coder. The JBIG is the general name of the bi-level data encoding standard in the ITU (International Telecommunication Union). In the JBIG, the QM coder is used for encoding bi-level data.)
As such a type of encoding system in the related art, a system in which a template is fixed, an adaptive template system (see Yasuhiro Yamazaki, Humitaka Ono, Tadashi Yoshida and Toshiaki Endo, Progressive Build-up Coding Scheme for Bi-level Images -JBIG Algorithm-, 1991, Vol.20, No.1, Image Electronic Society Journal), and a system in which a template is selected according to a type of data (for example, see Japanese Laid-Open Patent Application No.6-261214) have been proposed. Further, see ITU-T (Telecommunication Standardization Sector of ITU), T.82 (03/93), Terminal Equipment and Protocols for Telematic Services, Information Technology--Coded Representation of Picture and Audio Information--Progressive Bi-level Image Compression, the teachings of which are hereby incorporated by reference, for the JBIG system.
In the system in which a template is fixed, based on statistics of compression rates in the system, the template which has the highest compression rate is determined and is used as the fixed template. In this system, a compression circuit can be simplified. However, in this system, when data which has characteristics significantly deviated from the average characteristics of the statistics, is encoded, a compression rate is degraded.
In the above-mentioned adaptive template system, during data compression, it is always determined which template results in the highest compression rate, and thus a template being used is dynamically changed. In this system, statistics are always taken and a template being used is changed according to the result of the statistics. Therefore, this system is appropriate for a case such as that where long data is encoded and characteristics of the data start to vary at a position of the data. However, if short data is processed, a time required for adaptively changing a template to be used makes up a significant portion of a whole compression processing period, and thus this system may not be an efficient compression system. Further, because which template is optimum is always determined, a circuit structure of the encoding/decoding apparatus will be complex.
In the system in which a template is selected according to a type of data, a respective template is provided to be used for compressing each one of a plurality of types of data. For example, when a color image is compressed, because each pixel comprises a plurality of bits, individual templates are used for a plurality of bit planes. However, in this method, because a template for each of the plurality of bit planes is fixed, the system is not satisfactory enough for a reason similar to the reason mentioned above for the above-described system in which a fixed template is used.
Further, a system, which processes color images in a manner in which a number of bits (number of bit planes) allocated for a single pixel varies, such as the above-described system in which a color image is processed, has been known. However, an encoding method in the related art can be applied only to a system in which a number of bit planes is fixed. Therefore, it has not been possible to apply a template-use encoding method to such a system which processes color images in a manner in which a number of bits allocated for a single pixel varies.